/**
 * 
 * Copyright 2013 by Hai Nguyen 
 *
 */

package com.avj.g17.chat.common.model;

import com.avj.g17.chat.common.ClientCallBack;
import java.io.Serializable;

/**
 * Client
 *
 * @author Hai Nguyen <hain186@gmail.com>
 * @version $Id: Client Jun 15, 2013 4:44:43 PM hainn $   
 */
public class Client implements Serializable{
    public String ip;
    public String username;
    public ClientCallBack clientCallBack;

    public Client(String ip) {
        this.ip = ip;
    }

    public Client(String ip, ClientCallBack clientCallBack) {
        this.ip = ip;
        this.clientCallBack = clientCallBack;
    }

    public Client(String ip, String username, ClientCallBack clientCallBack) {
        this.ip = ip;
        this.username = username;
        this.clientCallBack = clientCallBack;
    }
    
    

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public ClientCallBack getClientCallBack() {
        return clientCallBack;
    }

    public void setClientCallBack(ClientCallBack clientCallBack) {
        this.clientCallBack = clientCallBack;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 11 * hash + (this.ip != null ? this.ip.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Client other = (Client) obj;
        if ((this.ip == null) ? (other.ip != null) : !this.ip.equals(other.ip)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Client{" + "ip=" + ip + '}';
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
    
    
}
